import { member_role } from './const'

const key = 'member_role'

export function getRole() {
  return sessionStorage.getItem(key, "0");
}

export function setRole(value) {
  return sessionStorage.setItem(key, value)
}

export function removeRole() {
  return sessionStorage.removeItem(key)
}

export function isMemberRole() {
  const role = getRole()
  if (+role === member_role.lawyer || +role === member_role.saler) {
    return true
  } else {
    return false
  }
}
